﻿<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%option explicit%>
<%
Dim RZ_IN
RZ_IN=1
%>
<!--#include file="../conn.inc.asp" -->
<!--#include file="admin_inc/admin.function.asp" -->
<!--#include file="admin_inc/admin.sqlfunction.asp" -->
<%
'作者：山林客（ah_bill）
'博客：http://ruizhinet.blog.163.com
'网站：http://www.ruizhinet.cn
'本信息不会影响您网站的正常访问，请保留
checkadmin(1)
dim id,ad_type,ad_code,ad_imgswf,ad_imgswf_width,ad_imgswf_height,ad_alt,ad_link,ad_author,ad_addtime,ad_begintime,ad_endtime, ad_description, act,rsa,sqla
ad_type=HTMLEncode(request.Form("ad_type"))
ad_code=request.Form("ad_code")
ad_imgswf=HTMLEncode(request.Form("ad_imgswf"))
ad_imgswf_width=HTMLEncode(request.Form("ad_imgswf_width"))
ad_imgswf_height=HTMLEncode(request.Form("ad_imgswf_height"))
ad_alt=HTMLEncode(request.Form("ad_alt"))
ad_link=HTMLEncode(request.Form("ad_link"))
ad_author=HTMLEncode(request.Form("ad_author"))
ad_description=trim(request.Form("ad_description"))
ad_addtime=Now()
ad_begintime=HTMLEncode(request.Form("ad_begintime"))
ad_endtime=HTMLEncode(request.Form("ad_endtime"))
act=HTMLEncode(request.Form("act"))
id=HTMLEncode(request.Form("id"))
if ad_begintime="" then
ad_begintime=now()
end if
if ad_endtime="" then
ad_endtime="2099-12-31"
end if
If act="addsave" Then 
	Set rsa = Server.CreateObject("ADODB.Recordset")
	sqla = "select * from [c_advertise]"
	rsa.open sqla,conn,1,3
	rsa.addnew
	rsa("ad_type")=ad_type
	rsa("ad_code")=ad_code
	rsa("ad_alt")=ad_alt
	rsa("ad_imgswf")=ad_imgswf
	rsa("ad_imgswf_width")=ad_imgswf_width
	rsa("ad_imgswf_height")=ad_imgswf_height
	rsa("ad_link")=ad_link
	rsa("ad_click")=0
	rsa("ad_author")=ad_author
	rsa("ad_addtime")=ad_addtime
	rsa("ad_begintime")=ad_begintime
	rsa("ad_endtime")=ad_endtime
	rsa("ad_description")=ad_description
	rsa.update
	rsa.close
	Set rsa=Nothing 
	response.redirect("showmsg.asp?from=advertise_list.asp&msg=AddSuccess")
End If 
If act="modifysave" Then 
	Set rsa = Server.CreateObject("ADODB.Recordset")
	sqla = "select * from [c_advertise] where id="&id
	rsa.open sqla,conn,1,3
	rsa("ad_type")=ad_type
	rsa("ad_code")=ad_code
	rsa("ad_alt")=ad_alt
	rsa("ad_imgswf")=ad_imgswf
	rsa("ad_imgswf_width")=ad_imgswf_width
	rsa("ad_imgswf_height")=ad_imgswf_height
	rsa("ad_link")=ad_link
	rsa("ad_author")=ad_author
	rsa("ad_addtime")=ad_addtime
	rsa("ad_begintime")=ad_begintime
	rsa("ad_endtime")=ad_endtime
	rsa("ad_description")=ad_description
	rsa.update
	rsa.close
	response.redirect("showmsg.asp?from=advertise_list.asp&msg=ModifySuccess")
End If 
%>